package com.gxuwz.stats.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxuwz.stats.entity.ResearchProjectSum;
import com.gxuwz.stats.mapper.ResearchProjectSumMapper;
import com.gxuwz.stats.service.ResearchProjectSumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ResearchProjectSumServiceImpl extends ServiceImpl<ResearchProjectSumMapper,ResearchProjectSum> implements ResearchProjectSumService{

    @Autowired
    private ResearchProjectSumMapper researchProjectSumMapper;

    @Override
    public ResearchProjectSum getByUserId(int userId) {
        QueryWrapper<ResearchProjectSum> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id", userId);
        return researchProjectSumMapper.selectOne(queryWrapper);
    }
}
